import 'package:flutter/material.dart';

class CircleIconAndText extends StatelessWidget {
  final IconData icon;
  final String text;
  final Color color;
  final double size;
  final VoidCallback onPressed;

  CircleIconAndText(this.icon, this.text, this.color,
      {this.size, this.onPressed});

  @override
  Widget build(BuildContext context) {
    return new Container(
      color: Colors.white,
      child: new Column(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: <Widget>[
          new Container(
              child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Container(
                decoration: new BoxDecoration(
                  color: Colors.white,
                  border: Border.all(color: this.color),
                  shape: BoxShape.circle,
                ),
                child: new Padding(
                  padding: new EdgeInsets.all(10.0),
                  child: new IconButton(
                    icon: Icon(
                      this.icon,
                      color: this.color,
                      size: this.size ?? 40.0,
                    ),
                    onPressed: this.onPressed,
                  ),
                ),
              ),
              new Padding(
                padding: new EdgeInsets.only(bottom: 5.0),
                child: new Text(
                  this.text,
                  style: TextStyle(
                    color: Colors.black,
                    fontSize: 14.0,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              )
            ],
          )),
        ],
      ),
    );
  }
}
